export function getCurrentDateTime() {
	const now = new Date();
	const year = now.getFullYear();
	const month = String(now.getMonth() + 1).padStart(2, '0');
	const day = String(now.getDate()).padStart(2, '0');
	const hour = String(now.getHours()).padStart(2, '0');
	const minute = String(now.getMinutes()).padStart(2, '0');
	const second = String(now.getSeconds()).padStart(2, '0');

	const currentTime = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
	return currentTime;
}

export function conversionTime(time) {
  const date = new Date(time);
  const year = date.getFullYear();
  const month = ("0" + (date.getMonth() + 1)).slice(-2);
  const day = ("0" + date.getDate()).slice(-2);
  const hours = ("0" + date.getHours()).slice(-2);
  const minutes = ("0" + date.getMinutes()).slice(-2);
  const seconds = ("0" + date.getSeconds()).slice(-2);
  
  const convertedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  return convertedTime;
}

export function getCurrentTime() {
	const now = new Date();
	const hour = String(now.getHours()).padStart(2, '0');
	const minute = String(now.getMinutes()).padStart(2, '0');
	const second = String(now.getSeconds()).padStart(2, '0');

	const currentTime = `${hour}:${minute}:${second}`;
	return currentTime;
}

export function getHour() {
	const now = new Date();
	const hour = String(now.getHours()).padStart(2, '0');

	const currentTime = `${hour}`;
	return currentTime;
}